/*
 * IO_Device.h
 *
 *  Created on: 2012-6-26
 *      Author: Administrator
 */

#ifndef IO_DEVICE_H_
#define IO_DEVICE_H_


#define GetRelayStatus() RelaySet(10)

extern Err LedOff(void);
extern Err LedOn(void);
extern Err BellOff(void);
extern Err BellOn(void);
extern INT32U RelayClr(INT32U rid);
extern INT32U RelaySet(INT32U rid);
extern Err IO_Device_Init(void);
extern void Beep(INT32U n);

static __inline BOOLEAN GetEXT0(void)
{   
    INT32U i,c=0;
    for(i=0;i<100;i++)
    {
        if(!(LPC_GPIO2->FIOPIN&BIT(10)))
        {
            c++;
        }
    }
    return(c>80);
}

#endif /* IO_DEVICE_H_ */
